import java.util.*;

/**
 * @author hewei
 * @version 1.0
 * @description: 1235. 规划兼职工作
 * @date 2022/11/8 15:35
 */

public class JobScheduling {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int target = scanner.nextInt();
//        int temp = 2;
//        while (temp <= target) {
//            if (temp == target) {
//                System.out.println(target);
//                break;
//            } else if (target % temp == 0) {
//                System.out.println(temp);
//                target /= temp;
//            } else {
//                ++temp;
//            }

        boolean[] flag = new boolean[target + 1];
        for (int i = 2; i <= target; i++) {
            if (!flag[i]) {
                for (int j = i; j * i <= target; j++) {
                    flag[j * i] = true;
                }
            }
        }
        for (int i = 2; i <= target; i++) {
            if (!flag[i]) System.out.println(i);
        }
    }

    public int jobScheduling1(int[] startTime, int[] endTime, int[] profit) {
        TreeMap<Integer, Integer> map = new TreeMap<>();
        TreeMap<Integer, List<Integer>> count = new TreeMap<>();
        int n = startTime.length;
        for (int i = 0; i < n; i++) {
            if (!count.containsKey(startTime[i])) count.put(startTime[i], new ArrayList<>());
            count.get(startTime[i]).add(i);
        }
        while (!count.isEmpty()) {
            Map.Entry<Integer, List<Integer>> entry = count.pollLastEntry();
            Map.Entry<Integer, Integer> ceilingEntry = map.ceilingEntry(entry.getKey());
            int temp = ceilingEntry == null ? 0 : ceilingEntry.getValue();
            for (Integer index : entry.getValue()) {
                Map.Entry<Integer, Integer> next = map.ceilingEntry(endTime[index]);
                temp = Math.max(temp, profit[index] + (next == null ? 0 : next.getValue()));
            }
            map.put(entry.getKey(), temp);
        }
        return map.firstEntry().getValue();
    }

    public int jobScheduling(int[] startTime, int[] endTime, int[] profit) {
        int n = startTime.length;
        int[][] jobs = new int[n + 1][3];
        for (int i = 0; i < n; i++) {
            jobs[i] = new int[]{startTime[i], endTime[i], profit[i]};
        }
        jobs[n] = new int[]{Integer.MAX_VALUE, 0, 0};
        Arrays.sort(jobs, Comparator.comparingInt(a -> a[0]));
        int[] dp = new int[n + 1];
        for (int i = n - 1; i >= 0; i--) {
            dp[i] = dp[i + 1];
            int l = i + 1, r = n;
            while (l < r) {
                int mid = (r - l) / 2 + l;
                if (jobs[mid][0] >= jobs[i][1]) {
                    r = mid;
                } else {
                    l = mid + 1;
                }
            }
            dp[i] = Math.max(dp[i], dp[l] + jobs[i][2]);
        }
        return dp[0];
    }
}
